<template>
	<view class="authentication row">
		<view class="title">请选择您要认证的角色</view>
		<view class="role">
			<van-radio-group :value="radio" @change="onChange">
			  <van-radio name="1" checked-color="#F35323">
					<image src="../../static/image/doctorRole.png" style="width: 220rpx;height: 220rpx;" mode=""></image>
					<view class="roleName">医生</view>
				</van-radio>
			  <van-radio name="2" checked-color="#F35323">
					<image src="../../static/image/volunteerRole.png" style="width: 220rpx;height: 220rpx;" mode=""></image>
					<view class="roleName">志愿者</view>
				</van-radio>
			</van-radio-group>
		</view>
		<view class="btnBox commonBtnBox">
			<van-button round type="primary" @click="authentication">去认证</van-button>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'authentication',
		data() {
			return {
				radio: '1'
			}
		},
		methods: {
		onChange(event) {
				this.radio = event.detail
			},
			authentication() {
				let url = ''
				if (this.radio == '1') {
					url = '../doctorCenter/authentication'
				} else {
					url = '../volunteerCenter/authentication'
				}
				uni.navigateTo({
					url: url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.authentication {
		width: 100%;
		position: relative;
		min-height: 100vh;
		.title {
			padding: 44rpx 0;
			text-align: center;
			color: #333333;
			font-size: 44rpx;
		}
		.role {
			/deep/ .van-radio {
				justify-content: center;
				margin-top: 84rpx;
				position: relative;
				.van-radio__icon-wrap {
					position: absolute;
					right: 35%;
					top: 0;
					.van-radio__icon {
						opacity: 0;
					}
					.van-radio__icon--checked {
						opacity: 1;
					}
				}
			}
			.roleName {
				width: 100%;
				text-align: center;
			}
		}
	}
</style>
